<?php
	$checkSessionIdpage = $this->checkSessionIdpage;
	$idpage = $this->idpage;
	if($checkSessionIdpage == 0)
	{
		echo "<center style='color:#41BBDE; padding:20px 0px'>Chọn Page cần thao tác</center>";
	}
	else
	{
		$list_customer = $this->list_customer; ?>
		
		<table class="tbl-home" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<th width="5%">Stt</th>
				<th width="12%">Tên</th>
				<th width="10%">SĐT</th>
				<th width="20%">Lần đặt hàng gần nhất</th>
				<th width="10%">Đánh giá</th>
				<th width="20%">Email</th>
				<th width="10%">Facebook</th>
				<th width="20%">Công cụ</th>
			</tr>
			<?php
				$i = 1;
				foreach($list_customer as $key=>$value)
				{
					$latest_order = strtotime(substr($value['latest_order'], 0, 10));
					$latest_order =  date('d-m-Y', $latest_order);
			?>
			<tr>
				<td><?php echo $i++; ?></td>
				<td><?php echo $value['name']; ?></td>
				<td><?php echo $value['phone']; ?></td>
				<td style="text-align: left; padding:2px"><?php echo $latest_order; ?></td>
				<td><?php echo $value['rating']; ?></td>
				<td style="text-align: left; padding:2px"><?php echo $value['email']; ?></td>
				<td><a href="<?php echo $value['fb_address'];?>"><?php echo $value['fb_address'];?></a></td>
				<td align="center">
					<a onclick="viewCustomerDetails('<?php echo $value['name'] ?>', '<?php echo $value['phone'] ?>', '<?php echo $value['city'] ?>', '<?php echo $value['district'] ?>', '<?php echo $value['address'] ?>', '<?php echo $latest_order ?>', '<?php echo $value['rating'] ?>', '<?php echo $value['email'] ?>', '<?php echo $value['fb_address'] ?>', '<?php echo $value['idpage'] ?>')" 
					   href="javascript:void(0)"><img 
					   title="Chi tiết khách hàng" 
					   alt="detail" 
					   src="<?php echo APP_DOMAIN . '/application/templates/giaodien_admin/images/setting.png' ?>"/>
				   </a>
				</td>
			</tr>
			<?php
				}
			?>
		</table>
<?php	
	}
?>